//
//  StoreDynamicTextCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/30.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "StoreDynamicTextCell.h"

@implementation StoreDynamicTextCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

+ (CGFloat)calculateHeightWithModel:(CommonDynamicModel *)model {
    
    CGFloat labelHeight = [Utilities getStringHeightWithText:model.sdyContent font:[UIFont systemFontOfSize:16] viewWidth:TTScreenWidth-30];

    return  labelHeight + 140;
}


- (void)fillCellWithModel:(CommonDynamicModel *)model {
    
    [self.thumbBtn setTitle:[NSString stringWithFormat:@"%ld",model.sdyPraiseCount] forState:UIControlStateNormal];
    
    self.mainTitle.text = model.sdyTitle;
    self.subTitle.text = model.sdyContent;
    self.timeLab.text = model.sdyCreateTime;
    
}


- (void)layoutSubviews {
    [super layoutSubviews];
    

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        [self.thumbBtn pp_clipCorners:UIRectCornerAllCorners radius:10 border:1 color:UIColorHex(0x999999)];
        
    });
    
}

@end
